package com.zq.controllers;


import com.zq.quartz.QuartzManager;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class TestController {
    static Logger logger = LogManager.getLogger(LogManager.ROOT_LOGGER_NAME);


    @RequestMapping(value = "/login", method = RequestMethod.GET)
    //@ResponseBody  添加这个注解  返回的只是字符串
        public String index() {
        System.out.println("跳转到欢迎页面，index.jsp");
        return "index";
    }

    @RequestMapping(value = "/str", method = RequestMethod.GET)
    @ResponseBody
    public String str() {
        logger.info("添加定时任务");
        QuartzManager.addJob("JobName", "JobGroupName", "syncJobTrigger", "sycJobGroup", com.zq.quartz.NoticeJob.class, "0/1 * * * * ?");
        return "str";
    }

}